From 980c7b03e86daaea66ce36bbe4eae30856a8a40d Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 14 Mar 2016 23:20:37 +0000 Subject: [PATCH] module: Fix ABI change in 4.4.5 Move the new kallsyms fields in struct module to the end and hide them from genksyms. Restore the old fields but leave them zeroed - nothing outside the module loader and /proc/kallsyms implementation should be, or appears to be, using them. Gbp-Pq: Topic debian Gbp-Pq: Name module-fix-abi-change-in-4.4.5.patch --- include/linux/module.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index b229a9961d02..4a013cdb7d44 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -417,9 +417,10 @@ struct module { #endif #ifdef CONFIG_KALLSYMS - /* Protected by RCU and/or module_mutex: use rcu_dereference() */ - struct mod_kallsyms *kallsyms; - struct mod_kallsyms core_kallsyms; + /* bwh: Old kallsyms state; now just padding for ABI compat */ + Elf_Sym *symtab, *core_symtab; + unsigned int num_symtab, core_num_syms; + char *strtab, *core_strtab; /* Section attributes */ struct module_sect_attrs *sect_attrs; @@ -482,6 +483,12 @@ struct module { ctor_fn_t *ctors; unsigned int num_ctors; #endif + +#if defined(CONFIG_KALLSYMS) && !defined(__GENKSYMS__) + /* Protected by RCU and/or module_mutex: use rcu_dereference() */ + struct mod_kallsyms *kallsyms; + struct mod_kallsyms core_kallsyms; +#endif } ____cacheline_aligned; #ifndef MODULE_ARCH_INIT #define MODULE_ARCH_INIT {} -- 2.30.2